/*
 * @Author: taoyuqing
 * @Date: 2022-12-31 16:04:42
 * @Description: 容器
 */
import 'package:flutter/material.dart';
import 'package:spree/utils/utils.dart';

class CommonContainer extends StatelessWidget {
  final Widget? child;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final bool? showBorderRadius;
  final double?width;
  const CommonContainer(
      {Key? key, this.child, this.padding, this.margin, this.showBorderRadius, this.width})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      margin: margin,
      padding: padding ?? EdgeInsets.only(left: 15, right: 15, bottom: 5),
      decoration: BoxDecoration(
        borderRadius: showBorderRadius == true
            ? const BorderRadius.all(Radius.circular(8.0))
            : null,
        color: Utils().createMaterialColor(),
      ),
      child: child,
    );
  }
}
